import request from '@/utils/request'

// 创建机型信息
export function createMaterialMode(data) {
  return request({
    url: '/hs/material-mode/create',
    method: 'post',
    data: data
  })
}

// 更新机型信息
export function updateMaterialMode(data) {
  return request({
    url: '/hs/material-mode/update',
    method: 'put',
    data: data
  })
}

// 删除机型信息
export function deleteMaterialMode(id) {
  return request({
    url: '/hs/material-mode/delete?id=' + id,
    method: 'delete'
  })
}

// 获得机型信息
export function getMaterialMode(id) {
  return request({
    url: '/hs/material-mode/get?id=' + id,
    method: 'get'
  })
}

// 获得机型信息
export function getMaterialModeByMaterialCode(materialCode) {
  return request({
    url: '/hs/material-mode/get/' + materialCode,
    method: 'get'
  })
}

// 获得机型信息分页
export function getMaterialModePage(params) {
  return request({
    url: '/hs/material-mode/page',
    method: 'get',
    params
  })
}
// 导出机型信息 Excel
export function exportMaterialModeExcel(params) {
  return request({
    url: '/hs/material-mode/export-excel',
    method: 'get',
    params,
    responseType: 'blob'
  })
}
